package com.kehutong.question.mini;

import org.coraframework.inject.Inject;
import org.coraframework.json.JSONObject;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;
import com.kehutong.question.entity.QuestionCommon;
import com.kehutong.question.service.QuestionClassifyService;
import com.kehutong.question.service.QuestionCommonService;

/**
 * 小程序端-常见问题
 */
@MvcAction
@ReqMapping("/kht-bin/mini/crm/question/common")
public class QuestionCommonAction {

    @Inject
    private QuestionClassifyService classifyService;
    @Inject
    private QuestionCommonService questionService;

    @ReqMapping("/list")
    public Object list(JSONObject jsonObject) {
        jsonObject.put("showStatus", "1");
        return questionService.list(jsonObject);
    }

    @ReqMapping("/classify/list")
    public Object classifyList(JSONObject jsonObject) {
        jsonObject.put("enable", "1");
        return classifyService.list(jsonObject);
    }

    @ReqMapping("/detail")
    public Object detail(QuestionCommon question) {
        return questionService.detail(question);
    }
}
